$(function () {
    let timeIndex = 0;
    let time = setInterval(function () {
        let user = window.sessionStorage.getItem("zq-user");
        timeIndex++;
        if (timeIndex > 20 || user != null) {
            clearInterval(time);
            initProfile(user);
        }
    }, 100)

})

function initProfile(user) {
    let user_json = JSON.parse(user);
    $(".profile-user-left").append(`<div class="avatar h-14 w-14">
                            <img class="rounded-full" src="${user_json.user_image}" alt="avatar">
                        </div>
                        <div><h3 class="text-base font-medium text-slate-700 dark:text-navy-100">
                                ${user_json.username}
                            </h3>
                            <p class="text-xs+">
                            ${user_json.user_description === undefined ? "这个人很神秘，没有留下个人简介。" : user_json.user_description}

</p></div>`);
}